package com.wuseguang.springcloud.util;



import java.util.*;

/**
 * @Title:
 * @Description:
 * @Author:tankejun
 * @Date: 2020/2/27
 * @Version： 1.0
 */
public class UUIDGenerator {

    public UUIDGenerator() {
    }

    public static String getUUID() {
        UUID uuid = UUID.randomUUID();
        String str = uuid.toString();
        // "-"符号
        String temp = str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24);
        return temp;
    }

    //获得指定数量的UUID
    public static String[] getUUID(int number) {
        if (number < 1) {
            return null;
        }
        String[] ss = new String[number];
        for (int i = 0; i < number; i++) {
            ss[i] = getUUID();
        }
        return ss;
    }

    public static void main(String[] args) {
            String s = " {\n" +
                    "            \"userId\": \"23224\",\n" +
                    "            \"userName\": \"李法海\",\n" +
                    "            \"inout\": \"in\",\n" +
                    "            \"temperature\": \"\",\n" +
                    "            \"photoUrl\": \"\",\n" +
                    "            \"userType\": \"student\",\n" +
                    "            \"address\": \"广西玉林市容县珊萃中学学校大门\",\n" +
                    "            \"category\": \"face\",\n" +
                    "            \"time\": \"2020-09-30 16:36:13\"\n" +
                    "        }";


    }
}
